package com.etc.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.UUID;

public class Counter implements Serializable{

	private static final long serialVersionUID = 1535116698316469168L;
	private String id;   //编号，辨识每个用户
	private String loginId; //登录账号
	private String password;//登录密码
	private ArrayList<Role> roles;//账号所拥有的角色
	//登录
	public void login() {
		
	}
	//退出登录
	public void loginout() {
		
	}
	public Counter() {
		super();
	}
	public Counter(String id, String loginId, String password, ArrayList<Role> roles) {
		super();
		this.id = id;
		this.loginId = loginId;
		this.password = password;
		this.roles = roles;
	}
	
	public Counter(String loginId, String password, ArrayList<Role> roles) {
		super();
		this.id = UUID.randomUUID().toString().substring(0, 8);
		this.loginId = loginId;
		this.password = password;
		this.roles = roles;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getLoginId() {
		return loginId;
	}
	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public ArrayList<Role> getRoles() {
		return roles;
	}
	public void setRoles(ArrayList<Role> roles) {
		this.roles = roles;
	}
	@Override
	public String toString() {
		return "Counter [id=" + id + ", loginId=" + loginId + ", password=" + password + ", roles=" + roles + "]";
	}
	
}
